<template>
	<view class="content">
		<u-navbar title="提现记录" :border-bottom="false" back-icon-color="#ffffff" title-color="#fff" :background="{backgroundColor:'#2A2931'}"></u-navbar>
		<view class="list">
			<view class="item" v-for="item in loglist" :key="item.time">
				<view class="top">
					<view class="state" v-if="item.state == 0">零钱提现中</view>
					<view class="state" v-else-if="item.state == 2">零钱提现失败</view>
					<view class="state" v-else-if="item.state == 1">零钱提现成功</view>
					<view class="time">{{item.addtime}}</view>
				</view>
				<view class="middle">
					<view class="label">提现金额</view>
					<view class="money">￥{{item.money}}</view>
				</view>
				<view class="foot" v-if="item.paymethod == 0">提现账号：{{item.wxname}}</view>
				<view class="foot" v-if="item.paymethod == 1">提现账号：{{item.zhifuname}}</view>
				<view class="foot" v-if="item.state == 2">失败原因: {{item.reason}}</view>
				<view class="foot" v-else-if="item.state == 1">到账时间: {{ item.daotime }}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loglist: []
			}
		},
		onLoad() {
			this.getlog()
		},
		methods: {
			async getlog(){
				const { data: res } = await this.$Request({
					url:'apis/Home/Withdraw/getRecord?userid=' + this.$store.state.userid
				})
				if (res && res.code == 200) {
					this.loglist = res.result
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		display: flex;
		flex-direction: column;
		padding: 40rpx;
		background: #2A2931;
		/* #ifndef H5 */
		min-height: 100vh;
		/* #endif */
		/* #ifdef H5 */
		min-height: calc(100vh - 44px);
		/* #endif */
		.list{
			width: 100%;
			.item{
				margin:10rpx 0 40rpx 0;
				font-size:28rpx;
				.top{
					display: flex;
					justify-content: space-between;
					line-height: 70rpx;
					border-bottom: 2rpx dotted #D1D1D1;
					color: #969696;
				}
				.middle{
					padding: 10rpx 0;
					.label{
						font-size: 24rpx;
						color: rgb(213, 157, 81);
						line-height: 50rpx;
					}
					.money{
						font-size: 28rpx;
						color: rgb(213, 157, 81);
						font-weight: 600;
					}
				}
				.foot{
					line-height: 70rpx;
					border-top: 2rpx dotted #D1D1D1;
					color: rgb(213, 157, 81);
				}
			}
		}
	}
</style>
